package com.shrct.businessprocess.budget.impl;

import com.google.common.base.Objects;
import com.shrct.businessprocess.budget.RCSaleContractPayCondition;
import com.shrct.businessprocess.budget.RCSaleContractPayConditionDAO;
import com.shrct.businessprocess.budget.impl.RCSaleContractPayConditionImpl;
import com.shrct.businessprocess.common.RCSaleContractPayConditionCode;
import com.shrct.businessprocess.project.RCProject;
import com.uniquesoft.uidl.validation.Validates;
import edu.fudan.mylang.pf.BaseDAOService;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.budget.RCSaleContractPayConditionDAO")
public class RCSaleContractPayConditionDAOImpl extends BaseDAOService<RCSaleContractPayCondition> implements RCSaleContractPayConditionDAO {
  public RCSaleContractPayCondition create(final RCProject owner, final Procedure1<? super RCSaleContractPayCondition> preInit) {RCSaleContractPayCondition rCSaleContractPayCondition=RCSaleContractPayConditionImpl.create(owner,getObjectFactory());
    final Procedure1<RCSaleContractPayCondition> _function = new Procedure1<RCSaleContractPayCondition>() {
        public void apply(final RCSaleContractPayCondition it) {
          preInit.apply(it);
          RCSaleContractPayConditionCode _code = it.getCode();
          boolean _notEquals = (!Objects.equal(_code, null));
          Validates.Assert(_notEquals, "\u4ED8\u6B3E\u6761\u4EF6\u4EE3\u7801\u4E0D\u80FD\u4E3A\u7A7A");
          Double _payPrecent = it.getPayPrecent();
          boolean _notEquals_1 = (!Objects.equal(_payPrecent, null));
          Validates.Assert(_notEquals_1, "\u4ED8\u6B3E\u6761\u4EF6\u6BD4\u4F8B\u4E0D\u80FD\u4E3A\u7A7A");
          Integer _deliverDate = it.getDeliverDate();
          boolean _notEquals_2 = (!Objects.equal(_deliverDate, null));
          Validates.Assert(_notEquals_2, "\u4ED8\u6B3E\u6761\u4EF6\u8D85\u671F\u5929\u6570\u4E0D\u80FD\u4E3A\u7A7A");
        }
      };
    RCSaleContractPayCondition _doubleArrow = ObjectExtensions.<RCSaleContractPayCondition>operator_doubleArrow(rCSaleContractPayCondition, _function);
    return _doubleArrow;
  }
}
